# -*- coding:UTF-8 -*-
from cmdb.models import NetworkCardInfo

def del_network_card_info(equipment_no, cursor):
    network_card_del_sql = 'delete from network_card_info where equipment_no="' + equipment_no + '"'
    cursor.execute(network_card_del_sql)

def add_network_card_info(equipment_no, card_name, mac, cursor):
    net_carr_insert_sql = 'insert into network_card_info set equipment_no="' + equipment_no \
                                      + '",card_name="' + card_name + '",mac="' + mac + '"'
    cursor.execute(net_carr_insert_sql)

def get_network_card_info(equipment_no):
    netCardRes = NetworkCardInfo.objects.filter(equipment_no=equipment_no)
    return netCardRes
